import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/login.vue'
import Index from '../views/body/index.vue'
import Box from '../views/body/box.vue'
import Chat from '../views/body/chat.vue'
import Contact from '../views/body/contact.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/index',
    name: 'Index',
    component: Index,
    children: [
      {
        path: "/box",
        // path: "",
        name: "Box",
        component: Box,
        children: [
          {
            // path: "/chat/:ranId"
            path: '/chat/:ranId',
            name: 'Chat',
            component: Chat
          }
        ]
      },
      {
        path: "/contact",
        name: "Contact",
        component: Contact
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
